<?php

require_once('config.php');
require_once('functions.php');

    if (!function_exists('json_decode')) {
    
        kill('Installation error', 'The JSON functions are not enabled in PHP.');
    }
    
    if (!is_dir('themes/'. TM_THEME)
            || !file_exists('themes/'. TM_THEME .'/head.php')
                || !file_exists('themes/'. TM_THEME .'/foot.php')) {
    
        kill('Installation error', 'Please make sure the template and its files exist on your server [themes/'. TM_THEME .'/].');
    }
    
    if (!file_exists('cache.txt')) {
    
        kill('Cache file error', 'Please make sure the <em>cache.txt</em> file exists and is writable.');
    }
    
    if (!is_writable('cache.txt')) {
    
        kill('Cache file error', 'Please make sure the <em>cache.txt</em> file is writable.');
    }

displayTweets();

?>